package Runde8;

public class StonePit extends Storage {

	/**
	 * @postcondition Creates a new StonePit with given param as maximum capacity
	 */
	public StonePit(int max, int activeworkers) {
		super(max, activeworkers);
	}

	/**
	 * @postcondition Returns a readable output of StonePit
	 */
	public String toString() {
		return "StonePit";
	}
	
	/**
	 * @postcondition Returns true or false, whether StonePit is empty, or not. 
	 * 			Because the Logisticians always get 2 trees off the StonePit, 
	 * 			and there's the possibility that there's one left and no
	 * 			treecutters working anymore (odd amount of trees) current = 1
	 * 			also returns true
	 */
	public boolean isEmpty() {
		int t_current = Integer.parseInt(report().split(":")[1].split("/")[0].trim());
		return (t_current == 0 || t_current == 1);
	}

}
